package day09_Properties_topic7;
/*请编写程序，定义一个Properties对象，存储以下内容：*/

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class SaveIphone {
    public static void main(String[] args) {
        //定义properties对象
        Properties properties = new Properties();
        //设置属性值
        properties.setProperty("brand", "Iphone11Pro Max");
        properties.setProperty("capacity", "256G");
        properties.setProperty("price", "10899");
        //存入文件
        try(FileWriter fw = new FileWriter("src/iphone.properties")) {
            properties.store(fw,"ipone_massage");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
